program SFTrEdtC;

{$APPTYPE CONSOLE}

uses
  System.SysUtils, System.Generics.Collections,
  uChoices in '..\Common\uChoices.pas';

{$R *.res}

var
  choices: TList<TChoice>;
begin
  try
    if ParamCount < 3 then begin
      Writeln('Not enough parameters. Halt.');
      Halt;
    end;
    if ParamStr(1) = 'import1' then begin
      choices := TChoicesUtil.TryImportFromFile(ParamStr(2));
      TChoicesUtil.SaveFile(choices, ParamStr(3));
    end;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.